import 'package:flutter/material.dart';

class TodoData extends ChangeNotifier {
  List<String> title = ['Test'];
  List<String> body = ['Hello World.'];
  List<bool?> state = [false];

  void Add(String name,data){
    switch (name) {
      case 'title':
        title.add(data);
        break;
      case 'body':
        body.add(data);
        break;
      case 'state':
        state.add(data);
        break;
      default:
        print("Try correcting the name to the name of an existing getter, or defining a getter or field named '${name}'.");
    }
    notifyListeners();
  }

  void RemoveAt(String name,int data){
    switch (name) {
      case 'title':
        title.removeAt(data);
        break;
      case 'body':
        body.removeAt(data);
        break;
      case 'state':
        state.removeAt(data);
        break;
      default:
        print("Try correcting the name to the name of an existing getter, or defining a getter or field named '${name}'.");
    }
    notifyListeners();
  }
}